package com.babylove.inventory.domain;


import com.babylove.common.core.annotation.Excel;
import com.babylove.common.core.validate.Add;
import com.babylove.common.core.validate.Update;
import com.babylove.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;


/**
 * <p>
 * 仓库表
 * </p>
 *
 * @author caoqingwen
 * @since 2021-01-29
 */
@ApiModel(value = "Store对象", description = "仓库表")
public class InvStore extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @NotNull(message = "ID不能为空", groups = {Update.class})
    private Long id;

    @ApiModelProperty(value = "仓库名称")
    @NotBlank(message = "仓库名称不能为空", groups = {Add.class, Update.class})
    @Excel(name = "仓库名称", sort = 2)
    private String name;

    @ApiModelProperty(value = "仓库编码")
    @Excel(name = "仓库编码", sort = 1)
    private String code;

    @ApiModelProperty(value = "仓库地址")
    @NotBlank(message = "仓库地址不能为空", groups = {Add.class, Update.class})
    @Excel(name = "仓库地址", sort = 3)
    private String address;

    @ApiModelProperty(value = "仓库状态（0正常 1停用）")
    @NotBlank(message = "仓库状态不能为空", groups = {Add.class, Update.class})
    @Excel(name = "仓库状态", sort = 4, readConverterExp = "0=正常,1=停用")
    private String status;

    @ApiModelProperty(value = "删除标志（0代表存在 1代表删除）")
    private String delFlag;

    @Excel(name = "创建时间", sort = 5, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }
}
